<?php
/**
 * Created by PhpStorm.
 * User: hp
 * Date: 2020/2/10
 * Time: 13:04
 */

namespace libs\qrcode;

class Qrcode
{
    public static function getQrCode($str,$red=0,$green=0,$blue=0)
    {
        require_once "phpqrcode.php";
        ob_start();
        \QRcode::png($str,false,QR_ECLEVEL_L,3,4,false,$red,$green,$blue);
        $imgstr = base64_encode(ob_get_contents());
        ob_end_clean();
        return $imgstr;
    }
}